﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <link href="../../../../DataUser/Style/ccbpm.css" rel="stylesheet" type="text/css" />
    <link href="../../../Scripts/easyUI145/themes/icon.css" rel="stylesheet" type="text/css" />
    <link href="../../../Scripts/easyUI145/themes/default/easyui.css" rel="stylesheet" type="text/css" />
    <script src="../../../Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script src="../../../Scripts/easyUI/jquery.easyui.min.js" type="text/javascript"></script>
    <script src="../../../Scripts/QueryString.js" type="text/javascript"></script>
    <script type="text/javascript" src="../../../Scripts/config.js"></script>
    <script type="text/javascript" src="../../../Comm/Gener.js"></script>
    <script src="DDLBar.js" type="text/javascript"></script>
    <script src="../../CCFlowEnum.js" type="text/javascript"></script>
    <script src="../../../Scripts/EasyUIUtility.js" type="text/javascript"></script>
    <script src="../../../Scripts/vue.js"></script>
    <!-- 自己的系统风格统一. -->
    <link href="../../../Style/skin/adminfont/iconfont.css" rel="stylesheet" />
    <link href="../../../Style/skin/css/Default.css" rel="stylesheet" />
    <!-- 自己的系统风格统一end -->
</head>

<body>
    <div id="App">
        <div id="bar"> </div>

        <fieldset>
            <legend>设置</legend>
            <ul>
                <li>
                    <a href="javascript:void(0)" @click="OpenDialog(0)">设置/更改本组织处理人</a>
                </li>
                <li v-show="isShow">
                    <a href="javascript:void(0)" @click="OpenDialog(1)">设置/更改集团处理人</a>
                </li>

            </ul>
        </fieldset>

        <fieldset>
            <legend>绑定的人员</legend>
            <div id="emp">
                <ul>
                    <li v-show="emps.length===0">未设置</li>
                    <template v-for="emp in emps">
                        <li v-if="emp.FK_EmpText!=undefined"> <img src="../../../Img/Author.gif" /> {{emp.FK_EmpText}}</li>
                    </template>
                </ul>
            </div>
        </fieldset>

        <fieldset>
            <legend id="help"></legend>
            <ul>
                <li>说明：绑定的所有的人员，都可以处理该节点的工作。</li>
                <li> 绑定多少个人，当前节点就有多少个人处理，这一种是最简洁最直接的方式。</li>
                <li> 适用于当前节点人员比较稳定，一般不会变化的情况。</li>
                <li> 如果人员变化比较频繁，就需要设置岗位，让岗位设置人员。</li>
            </ul>
        </fieldset>


    </div>
    <script type="text/javascript">
        var Baseinfo = new Vue({
            el: '#App',
            data: {
                emps: [],
                deliverWay: DeliveryWay.ByBindEmp,
                isShow: true,
                webUser: {},
            },
            methods: {
                OpenDialog: function (type) {

                    var url = "../../../Comm/RefFunc/BranchesAndLeaf.htm?EnName=BP.WF.Template.NodeSheet&Dot2DotEnsName=BP.WF.Template.NodeEmps&Dot2DotEnName=BP.WF.Template.NodeEmp&AttrOfOneInMM=FK_Node&AttrOfMInMM=FK_Emp&EnsOfM=BP.Port.Emps&DefaultGroupAttrKey=FK_Dept";
                    var nodeID = GetQueryString("FK_Node");
                    url += '&NodeID=' + nodeID + '&PKVal=' + nodeID + "&M=" + Math.random();
                    var rootNo = 0;
                    //var webUser = new WebUser();
                    if (type == 0) {
                        if (this.webUser.CCBPMRunModel != 0)
                            rootNo = this.webUser.OrgNo;
                        url += "&RootNo=" + rootNo;
                    }
                    if (type == 1) {
                        if (this.webUser.CCBPMRunModel == 2)
                            rootNo = this.webUser.OrgNo;
                        if (this.webUser.CCBPMRunModel == 1) {
                            var orgs = new Entities("BP.WF.Port.Admin2Group.Orgs");
                            orgs.RetrieveCond("No", "=", "ParentNo");
                            if (orgs.length != 0) {
                                rootNo = orgs[0].No;
                            }

                        }
                        url += "&RootNo=" + rootNo;
                    }
                    OpenEasyUiDialogExtCloseFunc(url, '设置人员', 800, 500, function () {
                        Baseinfo.emps = getEmps();
                    });
                }
            },
            created() {
                InitBar(this.deliverWay);
                this.webUser = new WebUser();
                this.isShow = this.webUser.CCBPMRunModel == 2 ? false : true;
                this.emps = getEmps();
            }
        });

        //保存
        function Save() {

            var nodeID = GetQueryString("FK_Node");
            var node = new Entity("BP.WF.Node", nodeID);
            node.DeliveryWay = Baseinfo.deliverWay;
            node.Update();
        }
    </script>
</body>
</html>
